package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbCourseCommentMapper;
import com.ruoyi.teach.domain.NbCourseComment;
import com.ruoyi.teach.service.INbCourseCommentService;

/**
 * 课程评论Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbCourseCommentServiceImpl implements INbCourseCommentService 
{
    @Autowired
    private NbCourseCommentMapper nbCourseCommentMapper;

    /**
     * 查询课程评论
     * 
     * @param id 课程评论主键
     * @return 课程评论
     */
    @Override
    public NbCourseComment selectNbCourseCommentById(Long id)
    {
        return nbCourseCommentMapper.selectNbCourseCommentById(id);
    }

    /**
     * 查询课程评论列表
     * 
     * @param nbCourseComment 课程评论
     * @return 课程评论
     */
    @Override
    public List<NbCourseComment> selectNbCourseCommentList(NbCourseComment nbCourseComment)
    {
        return nbCourseCommentMapper.selectNbCourseCommentList(nbCourseComment);
    }

    /**
     * 新增课程评论
     * 
     * @param nbCourseComment 课程评论
     * @return 结果
     */
    @Override
    public int insertNbCourseComment(NbCourseComment nbCourseComment)
    {
        nbCourseComment.setCreateTime(DateUtils.getNowDate());
        return nbCourseCommentMapper.insertNbCourseComment(nbCourseComment);
    }

    /**
     * 修改课程评论
     * 
     * @param nbCourseComment 课程评论
     * @return 结果
     */
    @Override
    public int updateNbCourseComment(NbCourseComment nbCourseComment)
    {
        return nbCourseCommentMapper.updateNbCourseComment(nbCourseComment);
    }

    /**
     * 批量删除课程评论
     * 
     * @param ids 需要删除的课程评论主键
     * @return 结果
     */
    @Override
    public int deleteNbCourseCommentByIds(Long[] ids)
    {
        return nbCourseCommentMapper.deleteNbCourseCommentByIds(ids);
    }

    /**
     * 删除课程评论信息
     * 
     * @param id 课程评论主键
     * @return 结果
     */
    @Override
    public int deleteNbCourseCommentById(Long id)
    {
        return nbCourseCommentMapper.deleteNbCourseCommentById(id);
    }
}
